<?php if (!defined('THINK_PATH')) exit(); /*a:2:{s:71:"/www/wwwroot/mamingwang.cn/yzf/application/admin/view/qrcode/ewmck.html";i:1556282196;s:70:"/www/wwwroot/mamingwang.cn/yzf/application/admin/view/common/head.html";i:1556002984;}*/ ?>
<!DOCTYPE html>
<html>
  
  <head>
    <meta charset="UTF-8">
    <title>聚财国际</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
    <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
    <link rel="stylesheet" href="/public/static/css/font.css"> 
	<link href="/favicon.ico" type="image/x-icon" rel="shortcut icon" /> 
    <link rel="stylesheet" href="/public/static/css/xadmin.css">
    <link href="/public/static/lib/layui/css/layui.css" rel="stylesheet">
    <script type="text/javascript" src="/public/static/js/jquery.min.js"></script>
    <script type="text/javascript" src="/public/static/lib/layui/layui.js" charset="utf-8"></script>
    <script type="text/javascript" src="/public/static/js/xadmin.js"></script>
    <!-- 让IE8/9支持媒体查询，从而兼容栅格 -->
    <!--[if lt IE 9]>
      <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
      <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
    <script type="text/css">
      #fff{
        border: red solid 1px;
      }
    </script>
  </head>
  
<script type="text/javascript" src="/public/static/js/jquery.min.js"></script>
<style type="text/css">
    imges{float: left;cursor:pointer;width:100px;height:100px}
</style>
<body>
<form class="layui-form" action="">
<table class="layui-table" >
    <thead>
    <tr>
        <th style="text-align: center">二维码</th>
        <th style="text-align: center">操作 </br>(锁定二维码不可用)</th>
    </tr>
    </thead>
    <?php if(is_array($a) || $a instanceof \think\Collection || $a instanceof \think\Paginator): $i = 0; $__LIST__ = $a;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$a): $mod = ($i % 2 );++$i;?>
    <tbody>
    <tr style="text-align: center">
        <td><a title="<?php echo $a['qid']; ?>" href="javascript:;" attr_id='<?php echo $a['qid']; ?>' onclick="banner_new(this)"><img src="/upload/ewm/<?php echo $a['q_picture']; ?>" name="imges" id="imges" style="cursor:pointer;width:100px;height:100px"></a></td>
        <td class="td-manage">
            <input type="checkbox" <?php if ($a['q_state'] ==0): ?>  checked="" <?php endif; ?> name="status[]" lay-skin="switch" lay-filter="switchSuodoing" lay-text="锁定|解锁" value="<?php echo $a['qid']; ?>">
        </td>
    </tr>
    </tbody>
    <?php endforeach; endif; else: echo "" ;endif; ?>
</table>
</form>
<script src="/public/static/lib/layui/layui.js"></script>
<script src="/public/static/js/jquery-3.3.1.min.js"></script>
<script>
    function banner_new(obj){
        var tid=$(obj).attr('attr_id');
        var url="<?php echo Url('admin/qrcode/ewmxq'); ?>?qid="+  tid;
        x_admin_show('查看',url);
    }
    layui.use(['laydate','form'], function() {
        var laydate = layui.laydate;
        var form = layui.form;
        //执行一个laydate实例
        form.on('switch(switchSuodoing)', function (data) {
            var id = data.value;
            //监听提交
            $.ajax({
                url: "<?php echo url('admin/qrcode/suoding'); ?>",
                type: "post",
                dataType: "JSON",
                data: {qid: id},
                success: function (res) {
                    if (res == 1) {
                        layer.msg('操作成功！');
                        return false;
                    } else if(res==0){
                        layer.msg('操作失败！');
                        return false;
                    }
                }
            });
        });
    });
</script>
</body>

</html>